package com.ruoyi.reward.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.reward.mapper.CommunityRedemptionCodeMapper;
import com.ruoyi.reward.domain.CommunityRedemptionCode;
import com.ruoyi.reward.service.ICommunityRedemptionCodeService;

/**
 * 商品兑换码Service业务层处理
 * 
 * @author xianyu
 * @date 2025-04-04
 */
@Service
public class CommunityRedemptionCodeServiceImpl implements ICommunityRedemptionCodeService 
{
    @Autowired
    private CommunityRedemptionCodeMapper communityRedemptionCodeMapper;

    /**
     * 查询商品兑换码
     * 
     * @param id 商品兑换码主键
     * @return 商品兑换码
     */
    @Override
    public CommunityRedemptionCode selectCommunityRedemptionCodeById(Long id)
    {
        return communityRedemptionCodeMapper.selectCommunityRedemptionCodeById(id);
    }

    /**
     * 查询商品兑换码列表
     * 
     * @param communityRedemptionCode 商品兑换码
     * @return 商品兑换码
     */
    @Override
    public List<CommunityRedemptionCode> selectCommunityRedemptionCodeList(CommunityRedemptionCode communityRedemptionCode)
    {
        return communityRedemptionCodeMapper.selectCommunityRedemptionCodeList(communityRedemptionCode);
    }

    /**
     * 新增商品兑换码
     * 
     * @param communityRedemptionCode 商品兑换码
     * @return 结果
     */
    @Override
    public int insertCommunityRedemptionCode(CommunityRedemptionCode communityRedemptionCode)
    {
        return communityRedemptionCodeMapper.insertCommunityRedemptionCode(communityRedemptionCode);
    }

    /**
     * 修改商品兑换码
     * 
     * @param communityRedemptionCode 商品兑换码
     * @return 结果
     */
    @Override
    public int updateCommunityRedemptionCode(CommunityRedemptionCode communityRedemptionCode)
    {
        return communityRedemptionCodeMapper.updateCommunityRedemptionCode(communityRedemptionCode);
    }

    /**
     * 批量删除商品兑换码
     * 
     * @param ids 需要删除的商品兑换码主键
     * @return 结果
     */
    @Override
    public int deleteCommunityRedemptionCodeByIds(Long[] ids)
    {
        return communityRedemptionCodeMapper.deleteCommunityRedemptionCodeByIds(ids);
    }

    /**
     * 删除商品兑换码信息
     * 
     * @param id 商品兑换码主键
     * @return 结果
     */
    @Override
    public int deleteCommunityRedemptionCodeById(Long id)
    {
        return communityRedemptionCodeMapper.deleteCommunityRedemptionCodeById(id);
    }
}
